<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :md="6" :sm="8">
            <a-form-item :label="$t('caseShunt.caseNo')">
              <a-input :placeholder="$t('caseShunt.caseNoInput')" v-model="queryParam.caseNo"></a-input>
            </a-form-item>
          </a-col>

            <a-col :md="6" :sm="8">
              <a-form-item :label="$t('caseShunt.leaveStudentStatus')">
                <a-select v-model="queryParam.studentStatus" :placeholder="$t('caseShunt.leaveStudentStatusInput')">
                  <a-select-option value="">{{$t('seek.seekSchool.select')}}</a-select-option>
                  <a-select-option value="1">good</a-select-option>
                  <a-select-option value="2">bad</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>

          <template v-if="toggleSearchStatus">

            <a-col :md="6" :sm="8">
              <a-form-item :label="$t('caseShunt.supervisorFollowupStatus')">
                <a-select v-model="queryParam.supervisorFollowupStatus" :placeholder="$t('caseShunt.selectSupervisorFollowupStatus')">
                  <a-select-option value="">{{$t('seek.seekSchool.select')}}</a-select-option>
                  <a-select-option value="1">good</a-select-option>
                  <a-select-option value="2">bad</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-item :label="$t('caseShunt.currentStatus')">
                <a-select v-model="queryParam.currentStatus" :placeholder="$t('caseShunt.selectCurrentStatus')">
                  <a-select-option value="">{{$t('seek.seekSchool.select')}}</a-select-option>
                  <a-select-option value="1">good</a-select-option>
                  <a-select-option value="2">bad</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>



          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">{{$t('seek.seekSchool.btnSearch')}}</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展開' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>


    <!-- 操作按钮区域 -->
    <div class="table-operator" style="border-top: 5px">
      <!--      //TODO 待配置刷新-->
      <a-button type="primary" icon="sync" @click="handleShuntList">刷新</a-button>

      <a-button type="primary" icon="download" @click="handleExportXls('個案分流列表')">{{$t('seek.seekSchool.btnExport')}}</a-button>

      <!--          <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
      <!--            <a-button type="primary" icon="import">导入</a-button>-->
      <!--          </a-upload>-->
      <!--          <j-third-app-button biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally"/>-->

    </div>


    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i>{{$t('seek.seekSchool.iSelectd')}}&nbsp;<a style="font-weight: 600">{{ selectedRowKeys.length }}</a>{{$t('seek.seekSchool.item')}}&nbsp;&nbsp;
        <a style="margin-left: 24px" @click="onClearSelected"></a>
      </div>

      <a-table
        ref="table"
        bordered
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange"
      >

      </a-table>
    </div>





  </a-card>
</template>

<script>
// import SeekModel from './modules/SeekModel'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil'
export default {
  name: "ShuntList",
  mixins: [JeecgListMixin],
  components: {
    // SeekModel,
  },
  data() {
    return {
      queryParam:{
        caseNo:'',
        studentStatus:'',
        supervisorFollowupStatus:'',
        currentStatus:''
      },
      columns: [
        {
          title: this.$t('caseShunt.caseNo'),
          align: "center",
          dataIndex: 'caseNo',
          width: 100,
          sorter: true
        },
        {
          title: this.$t('caseShunt.leaveStudentStatus'),
          align: "center",
          dataIndex: 'studentStatus',
          width: 100,
          customRender: (text) => {
                //字典值翻译通用方法
                return filterDictTextByCache('studentStatus', text);
              }
        },
        {
          title: this.$t('caseShunt.supervisorFollowupStatus'),
          align: "center",
          width: 100,
          dataIndex: 'supervisorFollowupStatus',
          customRender: (text) => {
            //字典值翻译通用方法
            return filterDictTextByCache('supervisorFollowupStatus', text);
          }
        },
        {
          title: this.$t('caseShunt.touchType'),
          align: "center",
          width: 100,
          dataIndex: 'touchType',
          customRender: (text) => {
            //字典值翻译通用方法
            return filterDictTextByCache('touchType', text);
          }
        },
        {
          title: this.$t('caseShunt.currentInfo'),
          align: "center",
          width: 100,
          dataIndex: 'currentInfo',

        },

        {
          title: this.$t('caseShunt.currentStatus'),
          align: "center",
          width: 100,
          dataIndex: 'currentStatus',
          customRender: (text) => {
            //字典值翻译通用方法
            return filterDictTextByCache('currentStatus', text);
          }
        },

        {
          title:  this.$t('caseShunt.leaveReason'),
          align: "center",
          width: 100,
          dataIndex: 'leaveReason',

        },
        {
          title:  this.$t('caseShunt.summary'),
          align: "center",
          width: 100,
          dataIndex: 'summary',

        },
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   scopedSlots: {customRender: 'action'},
        //   align: "center",
        //   width: 170
        // }

      ],
      url:{
        list: "/school/consult/shunt/list",
        exportXlsUrl: "/school/consult/shunt/exportXls"
      }
    }
  },
  created() {
    this.handleShuntList()
  },
  computed: {

  },
  methods: {

    handleShuntList(){
      console.log("加載個案分流頁面")
      this.loadData()
    },
  }

}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>